import pandas as pd
import numpy as np
pd.options.plotting.backend = "plotly"
np.random.seed(1)
df = pd.DataFrame(dict(
a=np.random.normal(loc=1, scale=2, size=100),
b=np.random.normal(loc=2, scale=1, size=100)
))
fig = df.plot.hist()
fig.show()
import pandas as pd
import numpy as np
pd.options.plotting.backend = "plotly"
np.random.seed(1)
df = pd.DataFrame(dict(
a=np.random.normal(loc=1, scale=2, size=100),
b=np.random.normal(loc=2, scale=1, size=100)
))
fig = df.boxplot()
fig.show()
# x and y given as DataFrame columns
import plotly.express as px
df = px.data.iris() # iris is a pandas DataFrame
fig = px.scatter(df, x="sepal_width", y="sepal_length")
fig.show()